package com.xiaoshuidi.cloud.module.rooms.controller.admin.roomstaterecord;


import com.xiaoshuidi.cloud.framework.common.pojo.CommonResult;
import com.xiaoshuidi.cloud.module.rooms.api.roomstate.vo.GetCurrentRecordRespVO;
import com.xiaoshuidi.cloud.module.rooms.enums.ApiConstants;
import com.xiaoshuidi.cloud.module.rooms.service.RoomStateRecordService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;


/**
 * <p>
 * 房态记录 前端控制器
 * </p>
 *
 * @author hans.zhang
 * @since 2023-05-15
 */

@Tag(name = "管理后台 - 房态接口")
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping(ApiConstants.NAME + "/roomstaterecord")
public class RoomStateRecordController {

    private final RoomStateRecordService roomStateRecordService;

//    @Operation(summary = "保存房态")
//    @Parameters({
//            @Parameter(name = "roomHouseId", description = "房源id"),
//            @Parameter(name = "state", description = "房态")
//    })
//    @PostMapping("/saverecord")
//    public CommonResult<Long> saveRecord(@RequestParam("roomHouseId") Long roomHouseId,@RequestParam("state") String state){
//        return roomStateRecordService.saveRecord(roomHouseId, state);
//    }

    @Operation(summary = "获取当前房态")
    @Parameters({
            @Parameter(name = "roomHouseId", description = "房源id")
    })
    @GetMapping( "/get-current-record")
    public CommonResult<GetCurrentRecordRespVO> getCurrentRecord(@RequestParam("roomHouseId") Long roomHouseId){
        return roomStateRecordService.getCurrentRecord(roomHouseId);
    }

}
